package com.ruoyi.common.core.domain.entity;

import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.Size;

/**
 * 车辆信息实体类
 *
 * @author ruoyi
 */
public class Vehicle extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 车辆ID */
    private Long id;

    /** 用户ID */
    private Long userId;

    /** 车牌号 */
    @Size(min = 0, max = 10, message = "车牌号长度不能超过10个字符")
    private String licensePlate;

    /** 手机号 */
    @Size(min = 0, max = 11, message = "手机号长度不能超过11个字符")
    private String phone; // 新增手机号字段

    public Vehicle() {}

    public Vehicle(Long id) {
        this.id = id;
    }

    // getter/setter方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getLicensePlate() {
        return licensePlate;
    }

    public void setLicensePlate(String licensePlate) {
        this.licensePlate = licensePlate;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("licensePlate", getLicensePlate())
                .append("phone", getPhone())
                .append("createBy", getCreateBy())      // 继承自BaseEntity
                .append("createTime", getCreateTime())  // 继承自BaseEntity
                .append("updateBy", getUpdateBy())      // 继承自BaseEntity
                .append("updateTime", getUpdateTime())  // 继承自BaseEntity
                .toString();
    }
}
